---@class Table_SceneClassItem
local Table_SceneClassItem = class("Table_SceneClassItem");

function Table_SceneClassItem:ctor()
    self.Id = 0;    --唯一ID
    self.Name = "";    --名称
    self.SceneImg = "";    --场景图片
    self.SceneAtlas = "";    --场景图集
    self.SceneName = "";    --场景资源
    self.ResName = "";    --资源名称
    self.SceneType = 0;    --副本类型
    self.TerrainHeightMax = 0;    --地表高度最大值
    self.MapSize = "";    --地表场景大小
    self.TerrainMap = "";    --地表高度图大小
    self.SceneMap = "";    --雷达图片大小
    self.SceneMapTexture = "";    --雷达地图资源
    self.Entry_Pos = "";    --入口坐标
    self.Safe__Pos = "";    --安全坐标
    self.BGMusic = 0;    --背景音乐ID
    self.PanelId = {};    --界面ID
end

function Table_SceneClassItem:Load(reader)
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Id = tonumber(self.temp); end
    self.Name = reader:ReadString();
    self.SceneImg = reader:ReadString();
    self.SceneAtlas = reader:ReadString();
    self.SceneName = reader:ReadString();
    self.ResName = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.SceneType = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.TerrainHeightMax = tonumber(self.temp); end
    self.MapSize = reader:ReadString();
    self.TerrainMap = reader:ReadString();
    self.SceneMap = reader:ReadString();
    self.SceneMapTexture = reader:ReadString();
    self.Entry_Pos = reader:ReadString();
    self.Safe__Pos = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.BGMusic = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.PanelId = Utility.StringToNumbers(self.temp, ";"); end
    self.temp = nil;
end

---@class Table_SceneClassMgr : IDataMgr
local Table_SceneClassMgr = class("Table_SceneClassMgr", IDataMgr);

function Table_SceneClassMgr:FileName()
    return "Txt/SceneClass.txt";
end

---@return Table_SceneClassItem
function Table_SceneClassMgr:GetItemById(id)
    return self.super:GetItemById(id)
end

---@return Table_SceneClassItem
function Table_SceneClassMgr:GetItemByIdx(idx)
    return self.super:GetItemByIdx(idx)
end

function Table_SceneClassMgr:Load(reader)
    local item = Table_SceneClassItem.new();
    item:Load(reader);
    self.mItemDic[item.Id] = self.mDataCount;
    table.insert(self.mItemList, item);
end

return Table_SceneClassMgr;